<template>
  <el-dialog v-model="isVisible" title="文件夹重命名">
    <el-form label-width="100px">
      <el-form-item label="文件夹名称">
        <el-input v-model="templateName" placeholder="请输入"></el-input>
      </el-form-item>
    </el-form>
    <template #footer>
      <el-button @click="closeModal">取消</el-button>
      <el-button type="primary" @click="confirmSaveAs">确认</el-button>
    </template>
  </el-dialog>
</template>

<script setup lang="ts">
import { ref } from 'vue';

const isVisible = ref(false);
const templateName = ref('');

const open = () => {
  isVisible.value = true;
};

const closeModal = () => {
  isVisible.value = false;
};

const confirmSaveAs = () => {
  console.log('确认另存为操作，模版名称:', templateName.value);
  closeModal();
};

defineExpose({
  open
});
</script>